import React, { useEffect, useState } from "react";
import { useNavigate } from "react-router-dom";
import { get } from "../../utils/request";

function quiz2() {
  const navigate = useNavigate();
  const [data, setData] = useState([]);
  useEffect(() => {
    get("/members/orders").then((res) => {
      setData(res.data.list);
      console.log(res.data.list);
    });
  }, []);

  return (
    <div>
      <p
        onClick={() => {
          navigate(-1);
        }}
        style={{ cursor: "pointer" }}
      >
        &lt;&lt;返回
      </p>
      <ul>
        {data.map((item: any) => (
          <li className="doctorLi" key={item.id}>
            <p>姓名:{item.region}</p>
            <p>地址：{item.address}</p>
            <p>问诊信息:{item.regionCode}</p>
          </li>
        ))}
      </ul>
    </div>
  );
}

export default quiz2;
